{extend name="common/main"/}

{block name="body"}
	<!-- 标题栏 -->
	<div class="main-title">
		<h2>{:lang("_USER_LIST_")}</h2>
	</div>
	<div class="clearfix button-box tool-box">
        <!-- 高级搜索 -->
		<div class="search-form col-md-offset-10 col-xs-2 ">
			<div class="input-group">
				<input type="text" name="nickname" class="search-input form-control" value="{:input('nickname')}" placeholder={:lang("_PLEASE_ENTER_A_USER_NAME_OR_ID_WITH_DOUBLE_")}>
				                   <span class="input-group-btn"><a class="btn" href="javascript:;" id="search" url="{:Url('userList')}"><i class="icon-search"></i></a></span>
			</div>
		</div>
    </div>
    <!-- 数据列表 -->
    <div class="data-table with-padding">
	<table class="table table-bordered table-striped ">
    <thead>
        <tr>
		<th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
		<th class="">UID</th>
		<th class="">{:lang("_NICKNAME_")}</th>
		<th class="">{:lang("_STATE_")}</th>
		<th class="">{:lang("_OPERATION_")}</th>
		</tr>
    </thead>
    <tbody>
		{notempty name="_list"}
		{volist name="_list" id="vo"}
		<tr>
            <td><input class="ids" type="checkbox" name="id[]" value="{$vo.uid}" /></td>
			<td>{$vo.uid} </td>
			<td>{$vo.nickname}</td>
			<td>{$vo.status_text}</td>
			<td>
                <a href="{:Url('Rank/userRankList?id='.$vo['uid'])}">{:lang("_USER_TITLE_LIST_")}</a>
                <a href="{:Url('Rank/userAddRank?id='.$vo['uid'])}">{:lang("_ASSOCIATED_NEW_TITLE_")}</a>
            </td>
		</tr>
		{/volist}
		{else/}
		<td colspan="9" class="text-center"> aOh!{:lang("_THERE_IS_NO_CONTENT_")} </td>
		{/notempty}
	</tbody>
    </table>

    <div class="page">
        {$page}
    </div>
	</div>
    
{/block}

{block name="script"}
	<script type="text/javascript">
	//搜索功能
	$("#search").click(function(){
		var url = $(this).attr('url');
        var query  = $('.search-form').find('input').serialize();
        query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
        query = query.replace(/^&/g,'');
        if( url.indexOf('?')>0 ){
            url += '&' + query;
        }else{
            url += '?' + query;
        }
		window.location.href = url;
	});
	//回车搜索
	$(".search-input").keyup(function(e){
		if(e.keyCode === 13){
			$("#search").click();
			return false;
		}
	});
	</script>
{/block}
